
<div id="main">
  <div class="cl">&nbsp;</div>

  <!-- Content -->
  <div id="content">

    <!-- Box -->
    <div class="box">
      <!-- Box Head -->
      <div class="box-head">
        <h2 class="left">文章列表</h2>
        <div class="right">
          <label>search articles</label>
          <input type="text" class="field small-field" />
          <input type="submit" class="button" value="search" />
        </div>
      </div>
      <!-- End Box Head -->

      <!-- Table -->
      <div class="table">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <th width="13"><input type="checkbox" class="checkbox" /></th>
            <th>标题</th>
            <th>分类</th>
            <th>日期</th>
            <th width="110" class="ac">删除 编辑</th>
          </tr>

          <% @articles.each do |article| %>
            <tr class="<%= cycle("even", "odd") -%>">
              <td>
                <input type="checkbox" class="checkbox" />
              </td>
              <td>
                <h3><%= link_to article.title, edit_admin_article_path(article) -%></h3>
              </td>
              <td>
                <%= article.category.nil? ? "默认分类" : article.category.name %>
              </td>
              <td title="发表于：<%= article.created_at.to_s(:db) -%>">
                <%= article.created_at.strftime('%Y-%m-%d') -%>
              </td>
              <td>
                <%= link_to "Delete", admin_article_path(article), :method => :delete, :confirm => "是否删除这篇幅文章?" %>
                <%= link_to "Edit", edit_admin_article_path(article), :class => "ico edit" %>
              </td>
            </tr>
          <% end %>
        </table>

        <!-- Pagging -->
        <div class="pagging">
          <div class="left"><%= page_entries_info @article %></div>
          <div class="right">
            <%= will_paginate @article, :container => false, :inner_window => 1, :outer_window => 1, :previous_label => 'Previous', :next_label => 'Next' %>

          </div>
        </div>
        <!-- End Pagging -->
      </div>
      <!-- Table -->
    </div>
    <!-- End Box -->
  </div>
  <!-- End Content -->

  <!-- Sidebar -->
  <div id="sidebar">
    <!-- Box -->
    <div class="box">
      <!-- Box Head -->
      <div class="box-head">
        <h2>选项</h2>
      </div>
      <!-- End Box Head-->

      <div class="box-content">
        <%= link_to "<span>发布文章</span>".html_safe, new_admin_article_path, :class => "add-button" %>
        <%= link_to "<span>创建分类</span>".html_safe, category_admin_articles_path, :class => "add-button" %>
        <div class="cl">&nbsp;</div>

        <p></p>

        <!-- Sort -->
        <div class="sort">
          <label>过滤器</label>
          <select class="field">
            <option value="">标题</option>
          </select>
          <select class="field">
            <option value="">分类</option>
          </select>
          <select class="field">
            <option value="">日期</option>
          </select>
        </div>
        <!-- End Sort -->

      </div>
    </div>
    <!-- End Box -->
  </div>
  <!-- End Sidebar -->

  <div class="cl">&nbsp;</div>
</div>